package com.yq.ylmall.client.cart;

import com.yq.ylmall.client.cart.fallback.CartFeignFallback;
import com.yq.ylmall.dto.cart.CartOrderDto;
import com.yq.ylmall.vo.cart.CartInfoPageVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Project: yourlife
 * @Name: CartFeignClient
 * @Author: Jack_Li
 * @Date: 2024/6/16 13:32
 */

@FeignClient(value = "ylmall-service-cart", fallback = CartFeignFallback.class)
public interface CartFeignClient {

    @GetMapping("/api/cart/getCartList/{id}")
    List<CartInfoPageVo> getCartList(@PathVariable("id") Long userId);

    @PostMapping("/api/cart/remove")
    void batchRemove(@RequestBody CartOrderDto cartOrderDto);

}
